﻿
/*----------------------------------------------------------------//
// 文件名：MoDept.cs
// 文件功能描述：实体 MoDept.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoDept
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoDept
	/// </summary>
	public partial class MoDept:ICloneable
	{
		#region 表Dept的字段
		private string _dept_id;
		private string _parent_dept_id;
		private string _dept_name;
		private string _dept_tel;
		private string _dept_manager_code;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoDept()
		{
		    
		    
		    
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoDept(MoDept item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoDept(string dept_id,string parent_dept_id,string dept_name,string dept_tel,string dept_manager_code,string rem)
		{
		this._dept_id=dept_id;
		this._parent_dept_id=parent_dept_id;
		this._dept_name=dept_name;
		this._dept_tel=dept_tel;
		this._dept_manager_code=dept_manager_code;
		this._rem=rem;
		}
		#endregion
		
		#region 表Dept的字段属性
		/// <summary>
		/// DEPT_ID
		/// </summary>
		public string Dept_Id
		{
			get {return _dept_id;}
			set {_dept_id=value;}
		}
		/// <summary>
		/// DEP_DEPT_ID
		/// </summary>
		public string Parent_Dept_Id
		{
			get {return _parent_dept_id;}
			set {_parent_dept_id=value;}
		}
		/// <summary>
		/// DEPT_NAME
		/// </summary>
		public string Dept_Name
		{
			get {return _dept_name;}
			set {_dept_name=value;}
		}
		/// <summary>
		/// DEPT_TEL
		/// </summary>
		public string Dept_Tel
		{
			get {return _dept_tel;}
			set {_dept_tel=value;}
		}
		/// <summary>
		///此字段来源于人员编码，可以为空。
		/// </summary>
		public string Dept_Manager_Code
		{
			get {return _dept_manager_code;}
			set {_dept_manager_code=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoDept CopyTo(MoDept item)
        {
		    item.Dept_Id=this.Dept_Id;
		    item.Parent_Dept_Id=this.Parent_Dept_Id;
		    item.Dept_Name=this.Dept_Name;
		    item.Dept_Tel=this.Dept_Tel;
		    item.Dept_Manager_Code=this.Dept_Manager_Code;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoDept NewDept=new MoDept();
		    NewDept._dept_id=this._dept_id;
		    NewDept._parent_dept_id=this._parent_dept_id;
		    NewDept._dept_name=this._dept_name;
		    NewDept._dept_tel=this._dept_tel;
		    NewDept._dept_manager_code=this._dept_manager_code;
		    NewDept._rem=this._rem;
			return NewDept;
		}
		
		private static MoDept _empty = new MoDept(string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,string.Empty);
        public static MoDept Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoDept NewDept = obj as MoDept;
                if (NewDept == null)
                {
                    return false;
                }
                else
                {
				if (NewDept.Dept_Id==this.Dept_Id && NewDept.Parent_Dept_Id==this.Parent_Dept_Id && NewDept.Dept_Name==this.Dept_Name && NewDept.Dept_Tel==this.Dept_Tel && NewDept.Dept_Manager_Code==this.Dept_Manager_Code && NewDept.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Dept_Id={0}/Dep_Dept_Id={1}/Dept_Name={2}/Dept_Tel={3}/Dept_Manager_Code={4}/Rem={5}",_dept_id,_parent_dept_id,_dept_name,_dept_tel,_dept_manager_code,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Dept_ID"]!=null && row["Dept_ID"]!=DBNull.Value)
			{
			    this.Dept_Id = (string)row["Dept_ID"];
			}
			else
			{
				this.Dept_Id =string.Empty;
			}
		    if(row["Dep_Dept_ID"]!=null && row["Dep_Dept_ID"]!=DBNull.Value)
			{
			    this.Parent_Dept_Id = (string)row["Dep_Dept_ID"];
			}
			else
			{
				this.Parent_Dept_Id =string.Empty;
			}
		    if(row["Dept_Name"]!=null && row["Dept_Name"]!=DBNull.Value)
			{
			    this.Dept_Name = (string)row["Dept_Name"];
			}
			else
			{
				this.Dept_Name =string.Empty;
			}
		    if(row["Dept_Tel"]!=null && row["Dept_Tel"]!=DBNull.Value)
			{
			    this.Dept_Tel = (string)row["Dept_Tel"];
			}
			else
			{
				this.Dept_Tel =string.Empty;
			}
		    if(row["Dept_Manager_Code"]!=null && row["Dept_Manager_Code"]!=DBNull.Value)
			{
			    this.Dept_Manager_Code = (string)row["Dept_Manager_Code"];
			}
			else
			{
				this.Dept_Manager_Code =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Dept_ID"] = this.Dept_Id;
			row["Dep_Dept_ID"] = this.Parent_Dept_Id;
			row["Dept_Name"] = this.Dept_Name;
			row["Dept_Tel"] = this.Dept_Tel;
			row["Dept_Manager_Code"] = this.Dept_Manager_Code;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
